package com.duowei.diandan.callback;

import android.support.v7.util.DiffUtil;

import com.duowei.diandan.bean.food.FoodCate;

import java.util.List;

public class FoodCateDiffCallback extends DiffUtil.Callback {

    private final List<FoodCate> mOldList;
    private final List<FoodCate> mNewList;

    public FoodCateDiffCallback(List<FoodCate> oldList, List<FoodCate> newList) {
        mOldList = oldList;
        mNewList = newList;
    }

    @Override
    public int getOldListSize() {
        return mOldList.size();
    }

    @Override
    public int getNewListSize() {
        return mNewList.size();
    }

    @Override
    public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
        FoodCate oldItem = mOldList.get(oldItemPosition);
        FoodCate newItem = mNewList.get(newItemPosition);

        return oldItem.getDmjyxmsslb().getLbbm().equals(newItem.getDmjyxmsslb().getLbbm());
    }

    @Override
    public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
//        FoodCate oldItem = mOldList.get(oldItemPosition);
//        FoodCate newItem = mNewList.get(newItemPosition);
//
//        Dmjyxmsslb oldDmjyxmsslb = oldItem.getDmjyxmsslb();
//        Dmjyxmsslb newDmjyxmsslb = newItem.getDmjyxmsslb();


        return false;
    }
}
